<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>订单确认</title>
    <script src="js/flexible.js"></script>
    <link rel="stylesheet" href="css/flexible.css">
    <link rel="stylesheet" href="css/reset.css">
    <link rel="stylesheet" href="css/style.css">
    <link rel="stylesheet" href="css/vant.css">
    <script src="js/vue/vue.js"></script>
    <script src="js/vue/axios.js"></script>
    <script src="js/vue/MD5.js"></script>
    <script src="js/vue/vant.js"></script>
</head>
<body class="jfdh_back">
<div id="app">
    <template>
        <div class="jf_confirm">
            <div class="jfdh_confirm_img">
                <img :src="list.Pic" onerror="this.src='images/zwt1.png'"/>
            </div>
            <div class="jfdh_confirm_m">
                <p>{{list.GoodsName}}</p>
                <p>x1</p>
            </div>
            <div class="jfdh_confirm_m1">
                <p>{{list.Integral}}分</p>
                <p>会员积分</p>
            </div>
        </div>
        <div class="jf_confirm_html">
            <p>商品介绍</p>
            <div v-html="list.Info">
               
            </div>
        </div>
        <div class="jfdh_confirm_btn">
            <div @click="qrdh(list.id)">确认兑换</div>
            <div>
                合计: <span>{{list.Integral}}</span>
            </div>
        </div>
    </template>
</div>
</body>
<script>
var app = new Vue({
    el: '#app',
    data: {
        list:{},
        hello:'<span>hello world</span>'
    },
    created(){
        this.setCanS()
    },
    methods: {
         //设置参数
         setCanS(){
            let Request = new Object()
            Request = GetRequest()
            this.id=Request['id']
            this.getData()
        },
        getData(){
            getVs()
            const params={
                id:this.id
            }
            axios.get('/mobileapi/member/user_info.php?act=confirm_order',{params:params}).then(data =>{
                let { msg, code} = data.data
                    if (code != 200) {
                        window.vant.Toast.fail(msg)
                    } else {
                        data=data.data
                        this.list=data.data
                    }
                }).catch(function (error) {
                    window.vant.Toast.fail("请求失败，请联系管理员")
            })
       },
       //确认兑换
       qrdh(id){
        const params={
                id:this.id
            }
            axios.get('/mobileapi/member/user_info.php?act=confirm_order_go',{params:params}).then(data =>{
                let { msg, code} = data.data
                    if (code != 200) {
                        window.vant.Toast.fail(msg)
                    } else {
                        window.location.href='integralSuccess.html?id='+data.data.data.id+'&numberD='+data.data.data.cdkey+'' 
                    }
                }).catch(function (error) {
                    window.vant.Toast.fail("请求失败，请联系管理员")
            })
             
       }
    }  
})    
</script>
</html>